<div class="cart-list">
  <% carts.each do |cart| %>
    <% product = cart.product %>
    <div class="list-item">
      <%= product_small_img product %>
      <div class="info">
        <h1 class="price text-red">￥<%= product.msrp %></h1>
        <a href="/products/<%= product.id %>"><h1><%= product.title %></h1></a>
      </div>
      <div>
        *<%= cart.amount %>
      </div>
    </div>
  <% end %>
</div>

<hr class="line">

<div class="checkout-panel">
  <h1>商品价格：<span>￥<%= carts.sum { |cart| cart.amount * cart.product.price } %></span></h1>
  <h1>支付方式：<span>支付宝</span></h1>
</div>

<div class="order-new-menu">
  <div>应付总额：<span class="text-red">￥<%= carts.sum { |cart| cart.amount * cart.product.price } %></span></div>
  <%= form_tag orders_path, method: :post, class: "create-order-form", id: 'order_form' do %>
  <input type="hidden" name="address_id" value="<%= current_user.default_address.id if current_user.default_address %>" id="input_address_id"/>
  <button type="submit" class="submit-btn">去付款</button>
  <% end %>
</div>
